package com.maomao.permission.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.maomao.permission.entity.User;
import com.maomao.permission.mapper.UserMapper;

@RestController
public class UserController {
	@Value("${server.port}")
	private String port;
	
	@Autowired
	private UserMapper userMapper;
	
	@GetMapping("/user/{id}")
	public User user(@PathVariable Integer id ){
		System.out.println(port);
		return userMapper.selectByPrimaryKey(id);
	}
	
	@GetMapping("/hello")

	public String hello(){
		return "hello";
	}
}
